package com.jgj.zxkj.lookandcheckjggroupinfo.record.nocheck;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.SimpleClickListener;
import com.jgj.zxkj.lookandcheckjggroupinfo.record.detail.CheckDetailDelegate;
import com.sa.all_cui.mix_core.delegate.DoggerDelegate;

/**
 * Created by all-cui on 2017/11/1.
 */

@SuppressWarnings("WeakerAccess")
public class NoCheckItemClickListener extends SimpleClickListener {
    private final DoggerDelegate DELEGATE;
    private SimpleRecyclerAdapter mAdapter = null;

    private NoCheckItemClickListener(DoggerDelegate delegate, SimpleRecyclerAdapter adapter) {
        this.DELEGATE = delegate;
        this.mAdapter = adapter;
    }

    public static NoCheckItemClickListener create(DoggerDelegate delegate, SimpleRecyclerAdapter adapter) {
        return new NoCheckItemClickListener(delegate, adapter);
    }

    @Override
    public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
        final String id = mAdapter.getData().get(position).getField(PageDataType.ID);
        CheckDetailDelegate detailDelegate = CheckDetailDelegate.newInstance(id);
        DELEGATE.getParentDelegate().getSupportDelegate().start(detailDelegate);
    }

    @Override
    public void onItemLongClick(BaseQuickAdapter adapter, View view, int position) {

    }

    @Override
    public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {

    }

    @Override
    public void onItemChildLongClick(BaseQuickAdapter adapter, View view, int position) {

    }


}
